package com.myzhouye.starter.ticket.service;/***
 *                    _ooOoo_
 *                   o8888888o
 *                   88" . "88
 *                   (| -_- |)
 *                    O\ = /O
 *                ____/`---'\____
 *              .   ' \\| |// `.
 *               / \\||| : |||// \
 *             / _||||| -:- |||||- \
 *               | | \\\ - /// | |
 *             | \_| ''\---/'' | |
 *              \ .-\__ `-` ___/-. /
 *           ___`. .' /--.--\ `. . __
 *        ."" '< `.___\_<|>_/___.' >'"".
 *       | | : `- \`.;`\ _ /`;.`/ - ` : | |
 *         \ \ `-. \_ __\ /__ _/ .-` / /
 * ======`-.____`-.___\_____/___.-`____.-'======
 *                    `=---='
 *
 * .............................................
 *          佛祖保佑             永无BUG
 */

import com.myzhouye.starter.ticket.exception.TicketExpireException;

/**
 * @program: ticket-spring-boot-starter
 * @description:
 * @author: 那条蠢鱼
 * @create: 2024-11-14 16:22
 **/
public interface IticketUtilService {

    /**
     * 生成ticket
     * @param obj 票据含义
     * @return
     */
    String createTicket(Object obj);

    /**
     * 生成ticket并指定有效期
     * @param obj 票据含义
     * @param time 有效期,单位毫秒
     * @return
     */
    String createTicket(Object obj,long time);

    /**
     * 核销ticket
     * @param ticket
     * @return
     */
    Object checkTicket(String ticket) throws TicketExpireException;
}
